#include <stdio.h>
#include <dlfcn.h>

typedef ssize_t(*write_pfn_t)(int fd, const void *buf, size_t nbyte);

static write_pfn_t g_sys_write_func = NULL;

ssize_t write(int fd, const void *buf, size_t nbyte) {
    printf("xxxxxxxx\n");
    return g_sys_write_func(fd, buf, nbyte);
}

int main(int argc, const char **argv) {
    g_sys_write_func = (write_pfn_t)dlsym(RTLD_NEXT, "write");
    write(1, "hello", 5);
    return 0;
}
